<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>传智健康</title>
    <meta name="description" content="传智健康">
    <meta name="keywords" content="传智健康">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <script src="../plugins/elementui/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>

    <style type="text/css">
        .el-main {
            position: absolute;
            top: 70px;
            bottom: 0px;
            left: 200px;
            right: 10px;
            padding: 0;
        }
    </style>
</head>
<body class="hold-transition skin-purple sidebar-mini">
<div id="app">
    <el-container>
        <el-header class="main-header" style="height:70px;">
            <nav class="navbar navbar-static-top" :class=''>
                <!-- Logo -->
                <a href="#" class="logo" style="text-align:center">
                    <span class="logo-lg"><img src="../img/logo.png"></span>
                </a>
                <div class="right-menu">
                    <span class="help"><i class="fa fa-exclamation-circle" aria-hidden="true"></i>帮助</span>
                    <el-dropdown class="avatar-container right-menu-item" trigger="click">
                        <div class="avatar-wrapper">
                            <img src="../img/user2-160x160.jpg" class="user-avatar">
                            {{username}}
                        </div>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item divided>
                                <span style="display:block;">修改密码</span>
                            </el-dropdown-item>
                            <el-dropdown-item divided>
                                <span style="display:block;"> <a href="/user/logout">退出</a></span>
                            </el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </nav>
        </el-header>
        <el-container>
            <el-aside width="200px">
                <el-menu>
                    <el-submenu v-for="(menu,index) in menuList" :index="index">
                        <template slot="title">
                            <i class="fa" :class="menu.icon"></i>
                            {{menu.name}}
                        </template>
                        <template v-for="(child,c_index) in menu.children">
                            <el-menu-item :index="index+'-'+c_index">
                                <a :href="child.linkUrl" target="right">{{child.name}}</a>
                            </el-menu-item>
                        </template>
                    </el-submenu>
                </el-menu>
            </el-aside>
            <el-container>
                <iframe name="right" class="el-main" src="ordersetting.html" width="100%" height="690px"
                        frameborder="0"></iframe>
            </el-container>
        </el-container>
    </el-container>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/axios-0.18.0.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script>
    new Vue({
        el: '#app',
        data: {
            username: "",
            menuList: [
<!--                {-->
<!--                    "title": "工作台",-->
<!--                    "icon": "fa-dashboard",-->
<!--                    "children": [-->
<!--                        {-->
<!--                            "title": "分院设置",-->
<!--                            "linkUrl": "adress.html",-->
<!--                            "children": []-->
<!--                        }-->
<!--                    ]-->
<!--                },-->
<!--                {-->
<!--                    "title": "会员管理",-->
<!--                    "icon": "fa-user-md",-->
<!--                    "children": [-->
<!--                        {-->
<!--                            "title": "会员档案",-->
<!--                            "linkUrl": "member.html",-->
<!--                            "children": []-->
<!--                        }-->
<!--                    ]-->
<!--                },-->
<!--                {-->
<!--                    "title": "预约管理",-->
<!--                    "icon": "fa-tty",-->
<!--                    "children": [-->
<!--                        {-->
<!--                            "title": "预约列表",-->
<!--                            "linkUrl": "order_list.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "预约设置",-->
<!--                            "linkUrl": "ordersetting.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "套餐管理",-->
<!--                            "linkUrl": "setmeal.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "检查组管理",-->
<!--                            "linkUrl": "checkgroup.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "检查项管理",-->
<!--                            "linkUrl": "checkitem.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                    ]-->
<!--                },-->
<!--                {-->
<!--                    "title": "健康评估",-->
<!--                    "icon": "fa-stethoscope",-->
<!--                    "children": [-->
<!--                        {-->
<!--                            "title": "中医体质辨识",-->
<!--                            "linkUrl": "all-medical-list.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                    ]-->
<!--                },-->
<!--                {-->
<!--                    "title": "统计分析",     //菜单项名称-->
<!--                    "icon": "fa-heartbeat",-->
<!--                    "children": [//是否有子菜单，若没有，则为[]-->
<!--                        {-->
<!--                            "title": "会员数量统计",-->
<!--                            "linkUrl": "report_member.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "套餐预约统计",-->
<!--                            "linkUrl": "report_setmeal.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "运营数据统计",-->
<!--                            "linkUrl": "report_business.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "收入统计",-->
<!--                            "linkUrl": "report_income.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "预约/到诊",-->
<!--                            "linkUrl": "report_order.html",-->
<!--                            "children": []-->
<!--                        }-->
<!--                    ]-->
<!--                },-->
<!--                {-->
<!--                    "title": "系统管理",     //菜单项名称-->
<!--                    "icon": "fa-heartbeat",-->
<!--                    "children": [//是否有子菜单，若没有，则为[]-->
<!--                        {-->
<!--                            "title": "权限管理",-->
<!--                            "linkUrl": "sys_permission.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "角色管理",-->
<!--                            "linkUrl": "sys_role.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "菜单管理",-->
<!--                            "linkUrl": "sys_menu.html",-->
<!--                            "children": []-->
<!--                        },-->
<!--                        {-->
<!--                            "title": "用户管理",-->
<!--                            "linkUrl": "sys_user.html",-->
<!--                            "children": []-->
<!--                        }-->
<!--                    ]-->
<!--                }-->
            ]
        },
        created: function () {
            //发送异步请求获取登录用户名
            axios.get("/user/getUsername").then(response => {
                if (response.data.flag) {
                    this.username = response.data.data;
                    return;
                }
                this.$message.error(response.data.message);
            })
            //发送异步请求获取需展示的菜单列表
            axios.get("/user/menuList").then(response => {
                if (response.data.flag) {
                    this.menuList = response.data.data;
                    return;
                }
                this.$message.error(response.data.message);
            })
        }
    });
    $(function () {
        var wd = 200;
        $(".el-main").css('width', $('body').width() - wd + 'px');
    });
</script>
</html>
